//
//  ZTGetCarTableViewCell.m
//  app001
//
//  Created by xionghao on 15/10/8.
//  Copyright © 2015年 xionghao. All rights reserved.
//

#import "ZTGetCarTableViewCell.h"
#import "ZTActivityModel.h"
#import <UIImageView+WebCache.h>
#import "ZTListContent.h"

@implementation ZTGetCarTableViewCell
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *Id=@"getcarcell";
    
    ZTGetCarTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:Id];
    if (cell==nil) {
        [tableView registerNib:[UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil] forCellReuseIdentifier:Id];
        cell=[tableView dequeueReusableCellWithIdentifier:Id];
    }
    return cell;
}

-(void)setMode:(ZTActivityModel *)mode{
    _mode=mode;
    self.title.text=mode.title;
    self.time.text=[NSDate dateStrFromTimeStr:_mode.updatetime];
    ZTListContent *content=_mode.content[0];
    [self.pic1 sd_setImageWithURL:[NSURL URLWithString:[NSString getImageURLstr:content.pic]] placeholderImage:[UIImage imageNamed:@"ztplacehoder"]];
    if (_mode.content.count>=2) {
        ZTListContent *content1=_mode.content[1];
        [self.pic2 sd_setImageWithURL:[NSURL URLWithString:[NSString getImageURLstr:content1.pic]] placeholderImage:[UIImage imageNamed:@"ztplacehoder"]];
    }else{
        self.pic2.hidden=YES;
    }
    

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
